<!DOCTYPE html>

<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">

<title>README - TJPlurker API Documentation</title>

<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "./";
</script>

<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>


<body class="file">
<nav id="metadata">
  <nav id="home-section" class="section">
  <h3 class="section-header">
    <a href="./index.html">Home</a>
    <a href="./table_of_contents.html#classes">Classes</a>
    <a href="./table_of_contents.html#methods">Methods</a>
  </h3>
</nav>


  <nav id="search-section" class="section project-section" class="initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <h3 class="section-header">
      <input type="text" name="search" placeholder="Search" id="search-field"
             title="Type to search, Up and Down to navigate, Enter to load">
    </h3>
  </form>

  <ul id="search-results" class="initially-hidden"></ul>
</nav>


  <div id="project-metadata">
    <nav id="fileindex-section" class="section project-section">
  <h3 class="section-header">Pages</h3>

  <ul>
  
    <li class="file"><a href="./GETSTART.html">GETSTART</a>
  
    <li class="file"><a href="./MAKEROBOT.html">MAKEROBOT</a>
  
    <li class="file"><a href="./README.html">README</a>
  
  </ul>
</nav>

    <nav id="classindex-section" class="section project-section">
  <h3 class="section-header">Class and Module Index</h3>

  <ul class="link-list">
  
    <li><a href="./Legacy.html">Legacy</a>
  
    <li><a href="./Legacy/TJPlurker.html">Legacy::TJPlurker</a>
  
    <li><a href="./Legacy/TJPlurker/NotificationData.html">Legacy::TJPlurker::NotificationData</a>
  
    <li><a href="./Legacy/TJPlurker/Robot.html">Legacy::TJPlurker::Robot</a>
  
    <li><a href="./Legacy/TJPlurker/Service.html">Legacy::TJPlurker::Service</a>
  
    <li><a href="./Legacy/TJPlurker/ThreadService.html">Legacy::TJPlurker::ThreadService</a>
  
    <li><a href="./TJP.html">TJP</a>
  
    <li><a href="./TJP/NotificationData.html">TJP::NotificationData</a>
  
    <li><a href="./TJP/Robot.html">TJP::Robot</a>
  
    <li><a href="./TJP/Service.html">TJP::Service</a>
  
    <li><a href="./TJP/TJPlurker.html">TJP::TJPlurker</a>
  
    <li><a href="./TJP/ThreadService.html">TJP::ThreadService</a>
  
  </ul>
</nav>

  </div>
</nav>

<div id="documentation" class="description">
  
<h1 id="label-%E9%97%9C%E6%96%BCTJPlurker">關於TJPlurker</h1>
<ul><li>
<p><a href="http://code.google.com/p/tjplurker">Project Home</a></p>
</li><li>
<p><a href="http://cssula.nba.nctu.edu.tw">CSsula創意工坊</a></p>
</li><li>
<p><a href="http://cssula.twgg.org">CSsula機房</a></p>
</li></ul>

<h2 id="label-%E6%AD%B7%E5%8F%B2">歷史</h2>
<ul><li>
<p>2011/07/19 TJPlurker 1.3 released</p>
<ul><li>
<p>包裹Plurk所有的API</p>
</li></ul>
</li><li>
<p>2011/07/15 TJPlurker 1.2 released</p>
<ul><li>
<p>淘汰Plurk API 1.0，改用Plurk API 2.0</p>
</li></ul>
</li><li>
<p>2011/07/11 TJPlurker 1.0.4 released</p>
<ul><li>
<p>修正logger產生的bug，改良get_friends_by_offset至get_friend_list</p>
</li></ul>
</li><li>
<p>2011/05/28 TJPlurker 1.0.3 released</p>
<ul><li>
<p>修正Conneciton reset發出的Exception資訊</p>
</li></ul>
</li><li>
<p>2011/05/24 TJPlurker 1.0.2 released</p>
<ul><li>
<p>互動式機器人框架（ <a href="TJP/ThreadService.html">TJP::ThreadService</a> ）</p>
</li></ul>
</li><li>
<p>2011/05/24 TJPlurker 1.0.1 released</p>
</li><li>
<p>2011/05/23 TJPlurker 1.0 released</p>
<ul><li>
<p>基本的Plurk API包裹</p>
</li><li>
<p>回應式噗浪機器人框架</p>
</li></ul>
</li></ul>

<h2 id="label-%E7%89%B9%E8%89%B2">特色</h2>

<h3 id="label-%E6%9B%B4%E5%AE%89%E5%85%A8%E7%9A%84API%E5%8C%85%E8%A3%B9">更安全的API包裹</h3>

<p>Plurk官方提供的API其實有不少Bug，而其他第三方函式庫僅僅作到包裝而已，並沒有對這些Bug做一些安全的改寫（例如Timeout了不會重傳，使用者忘了進行登入也不會自動嘗試登入），導致使用上沒有想像中的的方便簡單，開發人員需要自行處理各式各樣的異常。有了TJPlurker可以把大部分的時間花應用上，而非處理這些瑣碎的問題。</p>

<h3 id="label-%E6%96%B9%E4%BE%BF%E7%9A%84%E6%89%93%E9%80%A0%E5%99%97%E6%B5%AA%E6%A9%9F%E5%99%A8%E4%BA%BA">方便的打造噗浪機器人</h3>

<p>有機器人框架，可以讓剛接觸TJPlurker的人在短時間內做出自己的機器人。</p>

<h2 id="label-%E6%89%8B%E5%86%8A">手冊</h2>
<ol><li>
<p><a href="GETSTART.html">豈不走</a></p>
</li><li>
<p><a href="MAKEROBOT.html">機器人製作指南</a></p>
</li></ol>

<h2 id="label-%E7%AF%84%E4%BE%8B">範例</h2>

<h3 id="label-%E7%99%BC%E5%99%97%E7%A4%BA%E7%AF%84">發噗示範</h3>

<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'tjplurker'</span>
<span class="ruby-identifier">include</span> <span class="ruby-constant">TJP</span>
<span class="ruby-identifier">tjp</span> = <span class="ruby-constant">TJPlurker</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">CONSUMER_KEY</span>, <span class="ruby-constant">CONSUMER_SECRET</span>, <span class="ruby-constant">ACCESS_TOKEN</span>, <span class="ruby-constant">ACCESS_TOKEN_SECRET</span>)
<span class="ruby-identifier">tjp</span>.<span class="ruby-identifier">plurk_add</span>(<span class="ruby-string">&quot;Hello TJPlurker&quot;</span>)
</pre>

<h3 id="label-%E5%99%97%E6%B5%AA%E6%A9%9F%E5%99%A8%E4%BA%BA">噗浪機器人</h3>

<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'tjplurker'</span>
<span class="ruby-identifier">include</span> <span class="ruby-constant">TJP</span>
<span class="ruby-identifier">robot</span> = <span class="ruby-constant">Robot</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">CONSUMER_KEY</span>, <span class="ruby-constant">CONSUMER_SECRETE</span>, <span class="ruby-constant">ACCESS_TOKEN</span>, <span class="ruby-constant">ACCESS_TOKEN_SECRET</span>)
<span class="ruby-identifier">service_echo</span> = <span class="ruby-constant">Service</span>.<span class="ruby-identifier">new</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">tjp</span>, <span class="ruby-identifier">data</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">p</span> <span class="ruby-identifier">data</span>
}
<span class="ruby-identifier">robot</span>.<span class="ruby-identifier">add_service</span>(<span class="ruby-identifier">service_echo</span>)
<span class="ruby-identifier">robot</span>.<span class="ruby-identifier">start</span>
</pre>

</div>



<footer id="validator-badges">
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
  <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
</footer>

